package com.kashow.bean.circle;

import android.os.Parcel;
import android.os.Parcelable;

import com.bilibili.boxing.model.entity.BaseMedia;

/**
 * Created by yybs on 16/12/26.
 */

public class SwitchCover implements Parcelable {
    private String url;
    private boolean selected;
    private BaseMedia mediaBean;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public BaseMedia getBaseMedia() {
        return mediaBean;
    }

    public void setBaseMedia(BaseMedia mediaBean) {
        this.mediaBean = mediaBean;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.url);
        dest.writeByte(this.selected ? (byte) 1 : (byte) 0);
        dest.writeParcelable(this.mediaBean, flags);
    }

    public SwitchCover() {
    }

    protected SwitchCover(Parcel in) {
        this.url = in.readString();
        this.selected = in.readByte() != 0;
        this.mediaBean = in.readParcelable(BaseMedia.class.getClassLoader());
    }

    public static final Creator<SwitchCover> CREATOR = new Creator<SwitchCover>() {
        @Override
        public SwitchCover createFromParcel(Parcel source) {
            return new SwitchCover(source);
        }

        @Override
        public SwitchCover[] newArray(int size) {
            return new SwitchCover[size];
        }
    };
}
